package org.crackjack.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "treatments")
public class Treatment extends Identify implements Serializable {

    private static final long serialVersionUID = 1321839553925726077L;
    private Appointment appointment;
    private Date treatmentTime;
    private Date reservationTime;

    public Treatment() {

    }

    @OneToOne(cascade = CascadeType.ALL)
    @Column(name = "appointment")
    public Appointment getAppointment() {
        return appointment;
    }

    public void setAppointment(Appointment appointment) {
        this.appointment = appointment;
    }

    @Column(name = "treatment_time")
    public Date getTreatmentTime() {
        return treatmentTime;
    }

    public void setTreatmentTime(Date treatmentTime) {
        this.treatmentTime = treatmentTime;
    }

    @Column(name = "reservation_time")
    public Date getReservationTime() {
        return reservationTime;
    }

    public void setReservationTime(Date reservationTime) {
        this.reservationTime = reservationTime;
    }

    @Override
    @Id
    @GeneratedValue
    @Column(name = "id")
    public Long getId() {
        return super.getId();
    }

}
